package com.jfinal.ext.util;

/**
 * @author Timor
 * @version 1.0
 * @date 2023/03/16 20:38:41
 */
public class UriFormatter {

    private UriFormatter() {}

    public static String format(String url){
        return format(url, false);
    }

    public static String format(String url, boolean processPointer){
        url = url.replaceAll("\\.+", processPointer ? "" : ".");
        url = url.replace("\\", "/");
        url = url.replaceAll("/+", "/");
        return url;
    }

}
